﻿' ******************************************************************************
' ** 
' **  Yahoo! Managed
' **  Written by Marius Häusler 2011
' **  It would be pleasant, if you contact me when you are using this code.
' **  Contact: YahooFinanceManaged@gmail.com
' **  Project Home: http://code.google.com/p/yahoo-finance-managed/
' **  
' ******************************************************************************
' **  
' **  Copyright 2011 Marius Häusler
' **  
' **  Licensed under the Apache License, Version 2.0 (the "License");
' **  you may not use this file except in compliance with the License.
' **  You may obtain a copy of the License at
' **  
' **    http://www.apache.org/licenses/LICENSE-2.0
' **  
' **  Unless required by applicable law or agreed to in writing, software
' **  distributed under the License is distributed on an "AS IS" BASIS,
' **  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
' **  See the License for the specific language governing permissions and
' **  limitations under the License.
' ** 
' ******************************************************************************

Namespace YahooManaged

    Public Class Culture
        Inherits Globalization.CultureInfo

        Private mLanguage As Language = Language.en
        Private mCountry As Country = Country.US

        Public ReadOnly Property Language() As Language
            Get
                Return mLanguage
            End Get
        End Property
        Public ReadOnly Property Country() As Country
            Get
                Return mCountry
            End Get
        End Property

        Public Sub New(ByVal lang As Language, ByVal cnt As Country)
            MyBase.New(lang.ToString.Replace("no", "nn").Replace("tzh", "zh") & "-" & cnt.ToString.Replace("CT", "ES").Replace("UK", "GB"))
            mLanguage = lang
            mCountry = cnt
        End Sub

        Public Overrides Function Clone() As Object
            Return New Culture(Me.Language, Me.Country)
        End Function
        Public Function CloneStrict() As Culture
            Return DirectCast(Me.Clone, Culture)
        End Function
        Public Overrides Function ToString() As String
            Return Me.DisplayName
        End Function





        Public MustInherit Class DefaultCultures
            Private Shared mItems(44) As Culture

            Friend Sub New()
            End Sub

            'New Culture(Language.en, Country.ID), _
            'New Culture(Language.tl, Country.PH), _
            Shared Sub New()
                mItems(0) = New Culture(Language.es, Country.AR)
                mItems(1) = New Culture(Language.de, Country.AT)
                mItems(2) = New Culture(Language.en, Country.AU)
                mItems(3) = New Culture(Language.pt, Country.BR)
                mItems(4) = New Culture(Language.en, Country.CA)
                mItems(5) = New Culture(Language.fr, Country.CA)
                mItems(6) = New Culture(Language.ca, Country.CT)
                mItems(7) = New Culture(Language.es, Country.CL)
                mItems(8) = New Culture(Language.es, Country.CO)
                mItems(9) = New Culture(Language.cs, Country.CZ)
                mItems(10) = New Culture(Language.da, Country.DK)
                mItems(11) = New Culture(Language.fi, Country.FI)
                mItems(12) = New Culture(Language.fr, Country.FR)
                mItems(13) = New Culture(Language.de, Country.DE)
                mItems(14) = New Culture(Language.tzh, Country.HK)
                mItems(15) = New Culture(Language.hu, Country.HU)
                mItems(16) = New Culture(Language.id, Country.ID)
                mItems(17) = New Culture(Language.en, Country.IN)
                mItems(18) = New Culture(Language.he, Country.IL)
                mItems(19) = New Culture(Language.it, Country.IT)
                mItems(20) = New Culture(Language.ja, Country.JP)
                mItems(21) = New Culture(Language.ko, Country.KR)
                mItems(22) = New Culture(Language.en, Country.MY)
                mItems(23) = New Culture(Language.ms, Country.MY)
                mItems(24) = New Culture(Language.es, Country.MX)
                mItems(25) = New Culture(Language.nl, Country.NL)
                mItems(26) = New Culture(Language.no, Country.NO)
                mItems(27) = New Culture(Language.en, Country.NZ)
                mItems(28) = New Culture(Language.es, Country.PE)
                mItems(29) = New Culture(Language.en, Country.PH)
                mItems(30) = New Culture(Language.ro, Country.RO)
                mItems(31) = New Culture(Language.ru, Country.RU)
                mItems(32) = New Culture(Language.en, Country.SG)
                mItems(33) = New Culture(Language.es, Country.ES)
                mItems(34) = New Culture(Language.fr, Country.CH)
                mItems(35) = New Culture(Language.de, Country.CH)
                mItems(36) = New Culture(Language.it, Country.CH)
                mItems(37) = New Culture(Language.th, Country.TH)
                mItems(38) = New Culture(Language.tr, Country.TR)
                mItems(39) = New Culture(Language.tzh, Country.TW)
                mItems(40) = New Culture(Language.en, Country.UK)
                mItems(41) = New Culture(Language.en, Country.US)
                mItems(42) = New Culture(Language.es, Country.US)
                mItems(43) = New Culture(Language.es, Country.VE)
                mItems(44) = New Culture(Language.vi, Country.VN)
            End Sub

            Public Shared ReadOnly Property Items() As Culture()
                Get
                    Return mItems
                End Get
            End Property

            Public Shared ReadOnly Property Argentina() As Culture
                Get
                    Return mItems(0)
                End Get
            End Property
            Public Shared ReadOnly Property Austria() As Culture
                Get
                    Return mItems(1)
                End Get
            End Property
            Public Shared ReadOnly Property Australia() As Culture
                Get
                    Return mItems(2)
                End Get
            End Property
            Public Shared ReadOnly Property Brazil() As Culture
                Get
                    Return mItems(3)
                End Get
            End Property
            Public Shared ReadOnly Property Canada_English() As Culture
                Get
                    Return mItems(4)
                End Get
            End Property
            Public Shared ReadOnly Property Canada_French() As Culture
                Get
                    Return mItems(5)
                End Get
            End Property
            Public Shared ReadOnly Property Catalan() As Culture
                Get
                    Return mItems(6)
                End Get
            End Property
            Public Shared ReadOnly Property Chile() As Culture
                Get
                    Return mItems(7)
                End Get
            End Property
            Public Shared ReadOnly Property Columbia() As Culture
                Get
                    Return mItems(8)
                End Get
            End Property
            Public Shared ReadOnly Property CzechRepublic() As Culture
                Get
                    Return mItems(9)
                End Get
            End Property
            Public Shared ReadOnly Property Denmark() As Culture
                Get
                    Return mItems(10)
                End Get
            End Property
            Public Shared ReadOnly Property Finland() As Culture
                Get
                    Return mItems(11)
                End Get
            End Property
            Public Shared ReadOnly Property France() As Culture
                Get
                    Return mItems(12)
                End Get
            End Property
            Public Shared ReadOnly Property Germany() As Culture
                Get
                    Return mItems(13)
                End Get
            End Property
            Public Shared ReadOnly Property HongKong() As Culture
                Get
                    Return mItems(14)
                End Get
            End Property
            Public Shared ReadOnly Property Hungary() As Culture
                Get
                    Return mItems(15)
                End Get
            End Property
            Public Shared ReadOnly Property Indonesia() As Culture
                Get
                    Return mItems(16)
                End Get
            End Property
            Public Shared ReadOnly Property India() As Culture
                Get
                    Return mItems(17)
                End Get
            End Property
            Public Shared ReadOnly Property Israel() As Culture
                Get
                    Return mItems(18)
                End Get
            End Property
            Public Shared ReadOnly Property Italy() As Culture
                Get
                    Return mItems(19)
                End Get
            End Property
            Public Shared ReadOnly Property Japan() As Culture
                Get
                    Return mItems(20)
                End Get
            End Property
            Public Shared ReadOnly Property Korea() As Culture
                Get
                    Return mItems(21)
                End Get
            End Property
            Public Shared ReadOnly Property Malaysia_English() As Culture
                Get
                    Return mItems(22)
                End Get
            End Property
            Public Shared ReadOnly Property Malaysia_Malaysian() As Culture
                Get
                    Return mItems(23)
                End Get
            End Property
            Public Shared ReadOnly Property Mexico() As Culture
                Get
                    Return mItems(24)
                End Get
            End Property
            Public Shared ReadOnly Property Netherlands() As Culture
                Get
                    Return mItems(25)
                End Get
            End Property
            Public Shared ReadOnly Property Norway() As Culture
                Get
                    Return mItems(26)
                End Get
            End Property
            Public Shared ReadOnly Property NewZealand() As Culture
                Get
                    Return mItems(27)
                End Get
            End Property
            Public Shared ReadOnly Property Peru() As Culture
                Get
                    Return mItems(28)
                End Get
            End Property
            Public Shared ReadOnly Property Philippines_English() As Culture
                Get
                    Return mItems(29)
                End Get
            End Property
            Public Shared ReadOnly Property Romania() As Culture
                Get
                    Return mItems(30)
                End Get
            End Property
            Public Shared ReadOnly Property Russia() As Culture
                Get
                    Return mItems(31)
                End Get
            End Property
            Public Shared ReadOnly Property Singapore() As Culture
                Get
                    Return mItems(32)
                End Get
            End Property
            Public Shared ReadOnly Property Spain() As Culture
                Get
                    Return mItems(33)
                End Get
            End Property
            Public Shared ReadOnly Property Switzerland_French() As Culture
                Get
                    Return mItems(34)
                End Get
            End Property
            Public Shared ReadOnly Property Switzerland_German() As Culture
                Get
                    Return mItems(35)
                End Get
            End Property
            Public Shared ReadOnly Property Switzerland_Italian() As Culture
                Get
                    Return mItems(36)
                End Get
            End Property
            Public Shared ReadOnly Property Thailand() As Culture
                Get
                    Return mItems(37)
                End Get
            End Property
            Public Shared ReadOnly Property Turkey() As Culture
                Get
                    Return mItems(38)
                End Get
            End Property
            Public Shared ReadOnly Property Taiwan() As Culture
                Get
                    Return mItems(39)
                End Get
            End Property
            Public Shared ReadOnly Property UnitedKingdom() As Culture
                Get
                    Return mItems(40)
                End Get
            End Property
            Public Shared ReadOnly Property UnitedStates_English() As Culture
                Get
                    Return mItems(41)
                End Get
            End Property
            Public Shared ReadOnly Property UnitedStates_Spanish() As Culture
                Get
                    Return mItems(42)
                End Get
            End Property
            Public Shared ReadOnly Property Venezuela() As Culture
                Get
                    Return mItems(43)
                End Get
            End Property
            Public Shared ReadOnly Property Vietnam() As Culture
                Get
                    Return mItems(44)
                End Get
            End Property

        End Class

    End Class


End Namespace